<template>
	<view class="p-20 ">
		<view class="type-select flex row-between bg-white bold md" @click="selectCar">
			<view>
				订单车型
			</view>
			<view class="flex">
				{{orderType}}
				<u-icon class="m-l-10" name="arrow-right"></u-icon>
			</view>
		</view>
		<view class="m-t-20 desc-item bg-white" >
			<view class="title bold xl">
				费用计算说明（{{orderType}})
			</view>
			<u-parse :html="content"></u-parse>
		</view>
		<car-popup ref="carPopup" @sureCar="sureCar" ></car-popup>
		
		<!-- <u-popup mode="bottom" border-radius="20" v-model="typeShow" title="请选择订单车型" height="460">
			<view class="popup-top flex">
				<view class="text-center">
					2
				</view>
				<view class="text-right">
					1
				</view>
				<view class="text-right">
					1
				</view>
			</view>
			<view class="flex flex-wrap p-20">
				<view class="type-item" v-for="item in typeList" :key="item.id">
					<text>{{item.name}}</text>
					
				</view>
			</view>
		</u-popup> -->
	</view>
</template>

<script>
	import {carDetail} from '@/api/car'
	export default {
		data() {
			return {
				orderType:'',
				typeShow:true,
				content:'',
			}
		},
		methods: {
			selectCar(){
				this.$refs.carPopup.show = true;
				// this.typeShow = true;
			},
			sureCar(e){
				this.carDetailFun(e)
				
			},
			carDetailFun(id){
				carDetail({id}).then(res=>{
					console.log("富文本到这里了");
					console.log(res);
					if(res.code==1){
						console.log(res);
						this.orderType = res.data.info.car_name;
						this.content = res.data.info.explain;
					}
				})
			}
		},
		onLoad({id}) {
			this.carDetailFun(id);
			this.$refs.carPopup.value = id;
		}
	}
</script>

<style lang="scss"  >
	.type-select{
		height: 100upx;
		padding: 0upx 20upx;
	}
	.desc-item{
		padding:  30upx;
		.title{
			padding-bottom: 20upx;
		}
	}
	.popup-top{
		height: 44upx;
		line-height: 44upx;
		padding: 0upx 20upx;
		view{
			// display: inline-block;
		}
	}
	.type-item{
		display: inline-block;
		text-align: center;
		margin-top: 10upx;
		margin-bottom: 20upx;
		flex: 0 0 50%;
		text{
			border:1upx solid #333;
			padding: 10upx 30upx;
		}
	}
</style>
